<?php
namespace Home\Controller;
use Think\Controller;
use Think\Verify;
use Think\Session\Driver;
class LoginController extends Controller {

	public function login() {
        $where['username'] = I("post.username","","htmlspecialchars");
		$where['password'] = md5(I("post.password","","htmlspecialchars"));  //md5 加密
		$account = M("account");
		$result = $account->where($where)->find();
		
		if($result){
			$_SESSION['user'] = $result['username'];
			session('[start]');
			session('name',$result['username']);
			$this->redirect('Index/index');
			
		}
		$this->display();
	}


}